//
//  LSTestWrongQuesViewController.m
//  听说弱点强化训练
//
//  Created by 盛超 on 2018/8/23.
//  Copyright © 2018年 盛超. All rights reserved.
//

#import "LSTestWrongQuesViewController.h"
#import "LSWrongQuesController.h"
#import "WrongQuesListManager.h"

@interface LSTestWrongQuesViewController ()

@end

@implementation LSTestWrongQuesViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self addBYItemviews:@[@"nav_back"] mode:ByNavigationItemModeImage position:ByNavigationItemPositionModeLeft];
    
    UIImageView *imageView = [[UIImageView alloc] init];
    imageView.image = [UIImage imageNamed:@"大背景"];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.equalTo(self.view);
    }];
    
    UIButton *btn = [[UIButton alloc] init];
    btn.backgroundColor = [UIColor orangeColor];
    [btn setTitle:@"进入错题" forState:UIControlStateNormal];
    [btn addTarget:self action:@selector(pushWrong) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];
    [btn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.size.mas_equalTo(CGSizeMake(100, 40));
    }];
    
    UIImageView *navImageView = [[UIImageView alloc] init];
    navImageView.image = [UIImage imageNamed:@"content_nav"];
    [self.view addSubview:navImageView];
    [navImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.equalTo(self.view);
        make.height.mas_equalTo(kNavgationBar);
    }];
    
    [self loadData];
}

- (void)pushWrong {
    [self push:[[LSWrongQuesController alloc] init]];
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self setNaviAttributeWithTranslucent:YES stateBarLightContent:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)loadData {
    
    WrongQuesListManager *manager = [[WrongQuesListManager alloc] init];
    NSDictionary *dict = @{@"StuID":DR_UserInfo.UserID,
                           @"SchoolID":KGetUserDefaults(@"SchoolID"),
                           @"StageNo":KGetUserDefaults(@"TestLayer")
                           };
    manager.requestParam = @{@"DictString":[NSObject objectToJson:dict]};
    [manager requestWithCompltionSuccess:^(ModelWrongQuesList *model) {
        
    } failuer:^(NSString *error) {
        
    }];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
